package com.kly.user.enums;

import java.util.Objects;

/**
 * 会话操作类型：1-save chat 2-Cancel Save chat
 * 3-topping 4-Cancel topping 5-Remove chat
 * @author linqu
 */
public enum ConversationOPTypeType {

    SAVE_CHAT(1, "SAVE CHAT", "Save chat"),

    CANCEL_SAVE_CHAT(2, "CANCEL SAVE CHAT", "Cancel Save chat"),

    TOPPING(3, "TOPPING", "topping"),

    CANCEL_TOPPING(4, "CANCEL TOPPING", "Cancel topping"),

    REMOVE_CHAT(5, "REMOVE CHAT", "Remove chat"),

    ;

    private final int type;

    private final String Value;

    private final String description;


    ConversationOPTypeType(int type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static ConversationOPTypeType fromType(Integer type) {
        if (Objects.isNull(type)) {
            return null;
        }
        for (ConversationOPTypeType userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        return null;
    }
}
